package com.zone.infrastructure.persistent.dao;

import com.zone.infrastructure.persistent.po.StrategyAward;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: zongzi
 * @description: TODO
 * @date: 2024/5/20
 */
@Mapper
public interface IStrategyAwardDao {

    /**
     * 查询策略奖品
     *
     * @return
     */
    List<StrategyAward> queryStrategyAwardList();

    /**
     * 获取策略明细集合
     *
     * @param strategyId 策略id
     * @return
     */
    List<StrategyAward> listByStrategyId(@Param("strategyId") Long strategyId);

    /**
     * 获取策略明细
     *
     * @param strategyId 策略id
     * @param awardId    奖品id
     * @return 奖品策略
     */
    StrategyAward getStrategyAward(@Param("strategyId") Long strategyId, @Param("awardId") Integer awardId);

    /**
     * 扣减数据库中的奖品库存
     *
     * @param strategyId 策略id
     * @param awardId    奖品id
     */
    void awardStockDecr(@Param("strategyId") Long strategyId, @Param("awardId") Integer awardId);
}
